import request from '@/utils/request'

/* 分页查询缓存*/
export function selectCachePage(data) {
  return request({
    url: '/system/cache/selectCachePage',
    method: 'post',
    data: data
  })
}

/* 新增缓存*/
export function saveCache(data) {
  return request({
    url: '/system/cache/saveCache',
    method: 'post',
    data: data
  })
}

/* 修改缓存*/
export function updateCache(data) {
  return request({
    url: '/system/cache/updateCacheById',
    method: 'post',
    data: data
  })
}

/* 通过id查询缓存*/
export function selectCacheById(data) {
  return request({
    url: '/system/cache/selectCacheById/' + data,
    method: 'post'
  })
}

/* 删除缓存*/
export function deleteCache(data) {
  return request({
    url: '/system/cache/deleteCache',
    method: 'post',
    data: data
  })
}

/* 根据key获取value*/
export function getKey(data) {
  return request({
    url: '/system/cache/getKeys/' + data,
    method: 'post'
  })
}

/* 根据key删除缓存*/
export function deleteByKey(cacheCode, detailKey) {
  return request({
    url: '/system/cache/delete/' + cacheCode + '/' + detailKey,
    method: 'post'
  })
}

/* 根据key获取value*/
export function getDetail(cacheCode, detailKey) {
  return request({
    url: '/system/cache/getDetail/' + cacheCode + '/' + detailKey,
    method: 'post'
  })
}
